package com.demo.orders;

import com.demo.common.model.Borrow;
import com.demo.common.model.Orders;
import com.jfinal.kit.Kv;
import com.jfinal.plugin.activerecord.Page;
import com.jfinal.plugin.activerecord.SqlPara;

public class OrdersService {

    private Orders dao = new Orders().dao();


    public Page<Orders> paginate(int pageNumber, int pageSize) {
        return dao.paginate(pageNumber, pageSize, "select *", "from orders order by id asc");
    }

    public Page<Orders> paginate(int pageNumber, int pageSize, Kv cond) {
        SqlPara sqlPara = dao.getSqlPara("searchOrders",cond);
        return dao.paginate(pageNumber, pageSize, sqlPara);
    }

    public Orders findById(int id) {
        return dao.findById(id);
    }

    public void deleteById(int id) {
        dao.deleteById(id);
    }
}
